
  ___  ____  ____  ____  ____ (R)
 /__    /   ____/   /   ____/
___/   /   /___/   /   /___/   15.1   Copyright 1985-2017 StataCorp LLC
  Statistics/Data Analysis            StataCorp
                                      4905 Lakeway Drive
     MP - Parallel Edition            College Station, Texas 77845 USA
                                      800-STATA-PC        http://www.stata.com
                                      979-696-4600        stata@stata.com
                                      979-696-4601 (fax)

32-user 64-core Stata network perpetual license:
       Serial number:  501506200495
         Licensed to:  Harvard-MIT Data Center
                       Cambridge, MA

Notes:
      1.  Stata is running in batch mode.
      2.  Unicode is supported; see help unicode_advice.
      3.  More than 2 billion observations are allowed; see help obs_advice.
      4.  Maximum number of variables is set to 5000; see help set_maxvar.

. do "dofiles/5_estimates_figureA1.do" 

. /*
> Replication files for "Housing Discrimination and the Pollution Exposure Gap 
> in the United States" 
> */
. 
. 
. clear all

. set matsize 11000

. 
. use "../stores/toxic_discrimination_data.dta"

. 
. 
. loc quartiles 4

. 
. 
. set seed 1010101

. 
. *****************************************************************************
> *******************
. * Minority
. *****************************************************************************
> *******************
. 
. 
. disc_boot choice Minority_dec2 Minority_dec3 Minority_dec4 , varlist(i.gender
>  i.education_level i.order)
note: multiple positive outcomes within groups encountered.
note: 1,504 groups (4,512 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -1024.1059  
Iteration 1:   log pseudolikelihood = -1015.2916  
Iteration 2:   log pseudolikelihood = -1015.2709  
Iteration 3:   log pseudolikelihood = -1015.2709  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      3,012
                                                Wald chi2(8)      =      76.12
                                                Prob > chi2       =     0.0000
Log pseudolikelihood = -1015.2709               Pseudo R2         =     0.0795

                              (Std. Err. adjusted for 19 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice |      Coef.   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Minority_d~2 |  -.4045333   .1436863    -2.82   0.005    -.6408763   -.1681903
Minority_d~3 |  -.3603691    .124777    -2.89   0.004    -.5656089   -.1551292
Minority_d~4 |   .0509522   .1454234     0.35   0.726    -.1882481    .2901525
             |
      gender |
       male  |   -.318683   .0885049    -3.60   0.000    -.4642605   -.1731054
             |
education_~l |
        low  |  -.1874049   .1095226    -1.71   0.087    -.3675536   -.0072562
     medium  |  -.3285053   .1240857    -2.65   0.008    -.5326082   -.1244024
             |
       order |
          2  |  -.2915209    .222165    -1.31   0.189    -.6569499     .073908
          3  |  -.8753794   .1847423    -4.74   0.000    -1.179254   -.5715053
------------------------------------------------------------------------------
cluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Code

Bootstrap Corrected Estimates
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Minority_d~2 |  -.4045333   .1521327    -2.66   0.016     -.668341   -.1407256
Minority_d~3 |  -.3603691   .1249865    -2.88   0.010    -.5771036   -.1436345
Minority_d~4 |   .0509522   .1473569     0.35   0.734    -.2045741    .3064784
------------------------------------------------------------------------------

. mat def b=e(b)

. mat def V=e(V)

. 
. mat def C=J(3,3,.)

. forvalues i= 1/3{
  2.         mat C[`i',1]=b[1,`i'] // coefs
  3.         mat C[`i',2]=V[`i',`i'] // var
  4.         mat C[`i',3]=e(df_`i') // dofs
  5.         }

. 
. 
. loc quartiles 4

. matrix define M=J(`quartiles'-1,5,.)

. forvalues j = 2/`quartiles'{
  2.         loc i=  `j'-1
  3.                 
.         matrix M[`i',1] = C[`i',1] - invttail(C[`i',3],0.05)*sqrt(C[`i',2])
  4.         matrix M[`i',2] = C[`i',1] 
  5.         matrix M[`i',3] = C[`i',1] + invttail(C[`i',3],0.05)*sqrt(C[`i',2]
> )
  6. 
.         sum Minority if dec`j'==1
  7.         matrix M[`i',4]=`r(N)'
  8.         sum choice if White==1 &  dec`j'==1
  9.         matrix M[`i',5]=`r(mean)'
 10.         
.         mat list M
 11. 
. }

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    Minority |      2,043    .6666667    .4715199          0          1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |        681    .3906021    .4882439          0          1

M[3,5]
            c1          c2          c3          c4          c5
r1  -.66834101  -.40453332  -.14072562        2043   .39060206
r2           .           .           .           .           .
r3           .           .           .           .           .

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    Minority |      3,636    .6666667    .4714694          0          1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      1,212    .4141914    .4927852          0          1

M[3,5]
            c1          c2          c3          c4          c5
r1  -.66834101  -.40453332  -.14072562        2043   .39060206
r2  -.57710365  -.36036908  -.14363451        3636   .41419142
r3           .           .           .           .           .

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    Minority |      1,845    .6666667    .4715323          0          1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |        615    .3837398    .4866916          0          1

M[3,5]
            c1          c2          c3          c4          c5
r1  -.66834101  -.40453332  -.14072562        2043   .39060206
r2  -.57710365  -.36036908  -.14363451        3636   .41419142
r3  -.20457407   .05095217   .30647841        1845   .38373984

. 
. 
. 
. *--------------------------------------------------------------------
. preserve

. clear

. svmat M
number of observations will be reset to 3
Press any key to continue, or Break to abort
number of observations (_N) was 0, now 3

. gen n=_n

. replace M1=exp(M1)
(3 real changes made)

. replace M2=exp(M2)
(3 real changes made)

. replace M3=exp(M3)
(3 real changes made)

. 
. 
. rename M1 lci

. rename M2 coef

. rename M3 uci

. rename M4 obs

. rename M5 c_mean

. rename n deciles

. 
. 
. 
. save "../stores/aux/interquartile_toxconc_minority_full_set_bootcl.dta", repl
> ace
(note: file ../stores/aux/interquartile_toxconc_minority_full_set_bootcl.dta no
> t found)
file ../stores/aux/interquartile_toxconc_minority_full_set_bootcl.dta saved

. restore

. 
. 
. *****************************************************************************
> *******************
. * African American vs Hispanic/LatinX
. *****************************************************************************
> *******************
. 
. disc_boot choice Hispanic_dec2  Hispanic_dec3 Hispanic_dec4 ///
>                                         Black_dec2  Black_dec3 Black_dec4  , 
> varlist(i.gender i.education_level i.order)
note: multiple positive outcomes within groups encountered.
note: 1,504 groups (4,512 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -1008.3737  
Iteration 1:   log pseudolikelihood = -998.32005  
Iteration 2:   log pseudolikelihood = -998.26867  
Iteration 3:   log pseudolikelihood = -998.26867  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      3,012
                                                Wald chi2(11)     =     240.49
                                                Prob > chi2       =     0.0000
Log pseudolikelihood = -998.26867               Pseudo R2         =     0.0950

                              (Std. Err. adjusted for 19 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice |      Coef.   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Hispanic_d~2 |  -.1393016   .1370169    -1.02   0.309    -.3646743    .0860712
Hispanic_d~3 |  -.1081198   .0832432    -1.30   0.194    -.2450427     .028803
Hispanic_d~4 |   .2022769   .1671391     1.21   0.226    -.0726424    .4771962
  Black_dec2 |  -.6885981   .1583899    -4.35   0.000    -.9491263   -.4280698
  Black_dec3 |  -.6124026   .1874879    -3.27   0.001    -.9207927   -.3040125
  Black_dec4 |  -.1015328   .1644222    -0.62   0.537    -.3719833    .1689176
             |
      gender |
       male  |  -.3187876   .0912309    -3.49   0.000     -.468849   -.1687262
             |
education_~l |
        low  |  -.2242118   .1189869    -1.88   0.060    -.4199279   -.0284957
     medium  |  -.3501088   .1165321    -3.00   0.003    -.5417871   -.1584305
             |
       order |
          2  |  -.2836685   .2289466    -1.24   0.215    -.6602522    .0929152
          3  |  -.8797614   .1912051    -4.60   0.000    -1.194266    -.565257
------------------------------------------------------------------------------
cluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codeclus
> ter(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Code

Bootstrap Corrected Estimates
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Hispanic_d~2 |  -.1393016   .1386193    -1.00   0.328    -.3796762    .1010731
Hispanic_d~3 |  -.1081198   .0844959    -1.28   0.217    -.2546411    .0384014
Hispanic_d~4 |   .2022769   .1767069     1.14   0.267     -.104144    .5086979
  Black_dec2 |  -.6885981   .1781655    -3.86   0.001    -.9975484   -.3796477
  Black_dec3 |  -.6124026   .1832572    -3.34   0.004    -.9301822    -.294623
  Black_dec4 |  -.1015328   .1647984    -0.62   0.546    -.3873038    .1842382
------------------------------------------------------------------------------

. mat def b=e(b)

. mat def V=e(V)

. 
. *Matrices for boottest estimates
. *Hispanics
. mat def H_C=J(3,3,.)

. forvalues i= 1/3{
  2.         mat H_C[`i',1]=b[1,`i']
  3.         mat H_C[`i',2]=V[`i',`i']
  4.         mat H_C[`i',3]=e(df_`i')
  5.         }

. 
. *Af. Am.        
. mat def H_B=J(3,3,.)

. forvalues i= 4/6{
  2.         loc j=`i'-3
  3.         mat H_B[`j',1]=b[1,`i']
  4.         mat H_B[`j',2]=V[`i',`i']
  5.         mat H_B[`j',3]=e(df_`i')
  6.         }

.         
. *Matrices with results to export and plot
. matrix define H=J(`quartiles'-1,5,.)

. 
. forvalues j = 2/`quartiles'{
  2.         loc i=  `j'-1
  3.         
.         matrix H[`i',1] = H_C[`i',1] - invttail(H_C[`i',3],0.05)*sqrt(H_C[`i'
> ,2])
  4.         matrix H[`i',2] = H_C[`i',1] 
  5.         matrix H[`i',3] = H_C[`i',1] + invttail(H_C[`i',3],0.05)*sqrt(H_C[
> `i',2])
  6.         
.         sum Hispanic if dec`j'==1
  7.         matrix H[`i',4]=`r(N)'
  8.         sum choice if White==1 &  dec`j'==1
  9.         matrix H[`i',5]=`r(mean)'
 10.         
. }

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    Hispanic |      2,043    .3333333    .4715199          0          1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |        681    .3906021    .4882439          0          1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    Hispanic |      3,636    .3333333    .4714694          0          1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      1,212    .4141914    .4927852          0          1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    Hispanic |      1,845    .3333333    .4715323          0          1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |        615    .3837398    .4866916          0          1

. 
. 
. 
. matrix define B=J(`quartiles'-1,5,.)

. 
. forvalues j = 2/`quartiles'{
  2.         loc i=  `j'-1
  3.         
.         matrix B[`i',1] = H_B[`i',1] - invttail(H_B[`i',3],0.05)*sqrt(H_B[`i'
> ,2])
  4.         matrix B[`i',2] = H_B[`i',1] 
  5.         matrix B[`i',3] = H_B[`i',1] + invttail(H_B[`i',3],0.05)*sqrt(H_B[
> `i',2])
  6.         
.         sum Black if dec`j'==1
  7.         matrix B[`i',4]=`r(N)'
  8.         sum choice if White==1 &  dec`j'==1
  9.         matrix B[`i',5]=`r(mean)'
 10.         
. }

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       Black |      2,043    .3333333    .4715199          0          1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |        681    .3906021    .4882439          0          1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       Black |      3,636    .3333333    .4714694          0          1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      1,212    .4141914    .4927852          0          1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       Black |      1,845    .3333333    .4715323          0          1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |        615    .3837398    .4866916          0          1

. 
. mat list B

B[3,5]
            c1          c2          c3          c4          c5
r1  -.99754842  -.68859806   -.3796477        2043   .39060206
r2   -.9301822  -.61240258  -.29462295        3636   .41419142
r3  -.38730383  -.10153283   .18423816        1845   .38373984

. 
. clogit choice  Hispanic_dec2 Hispanic_dec3 Hispanic_dec4 ///
>                                          Black_dec2 Black_dec3 Black_dec4 ///
>                                          i.gender i.education_level i.order ,
>  or group(Address)  cl(Zip_Code) level(90)
note: multiple positive outcomes within groups encountered.
note: 1,504 groups (4,512 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -1008.3737  
Iteration 1:   log pseudolikelihood = -998.32005  
Iteration 2:   log pseudolikelihood = -998.26867  
Iteration 3:   log pseudolikelihood = -998.26867  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      3,012
                                                Wald chi2(11)     =     240.49
                                                Prob > chi2       =     0.0000
Log pseudolikelihood = -998.26867               Pseudo R2         =     0.0950

                              (Std. Err. adjusted for 19 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice | Odds Ratio   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Hispanic_d~2 |   .8699656      .1192    -1.02   0.309     .6944228    1.089884
Hispanic_d~3 |     .89752   .0747124    -1.30   0.194     .7826711    1.029222
Hispanic_d~4 |   1.224187   .2046095     1.21   0.226     .9299333     1.61155
  Black_dec2 |   .5022797   .0795561    -4.35   0.000     .3870791    .6517659
  Black_dec3 |    .542047   .1016272    -3.27   0.001     .3982033    .7378516
  Black_dec4 |   .9034515   .1485475    -0.62   0.537     .6893658    1.184023
             |
      gender |
       male  |     .72703   .0663276    -3.49   0.000     .6257221    .8447402
             |
education_~l |
        low  |   .7991458   .0950879    -1.88   0.060     .6570942    .9719065
     medium  |   .7046114   .0821099    -3.00   0.003     .5817078    .8534823
             |
       order |
          2  |   .7530162   .1724005    -1.24   0.215      .516721    1.097369
          3  |   .4148819   .0793275    -4.60   0.000     .3029263    .5682141
------------------------------------------------------------------------------

. 
. di (`e(N)'+`e(N_drop)')/3
2508

. *--------------------------------------------------------------------
. preserve

. clear

. svmat B
number of observations will be reset to 3
Press any key to continue, or Break to abort
number of observations (_N) was 0, now 3

. gen n=_n

. replace B1=exp(B1)
(3 real changes made)

. replace B2=exp(B2)
(3 real changes made)

. replace B3=exp(B3)
(3 real changes made)

. 
. 
. 
. rename B1 lci

. rename B2 or

. rename B3 uci

. rename B4 obs

. rename B5 c_mean

. rename n deciles

. 
. save "../stores/aux/interquartile_toxconc_AA_full_set_bootcl.dta", replace
(note: file ../stores/aux/interquartile_toxconc_AA_full_set_bootcl.dta not foun
> d)
file ../stores/aux/interquartile_toxconc_AA_full_set_bootcl.dta saved

. restore

. 
. 
. 
. 
. *--------------------------------------------------------------------
. preserve

. clear

. svmat H
number of observations will be reset to 3
Press any key to continue, or Break to abort
number of observations (_N) was 0, now 3

. gen n=_n

. replace H1=exp(H1)
(3 real changes made)

. replace H2=exp(H2)
(3 real changes made)

. replace H3=exp(H3)
(3 real changes made)

. 
. 
. 
. rename H1 lci

. rename H2 or

. rename H3 uci

. rename H4 obs

. rename H5 c_mean

. rename n deciles

. 
. 
. 
. save "../stores/aux/interquartile_toxconc_Hisp_full_set_bootcl.dta", replace
(note: file ../stores/aux/interquartile_toxconc_Hisp_full_set_bootcl.dta not fo
> und)
file ../stores/aux/interquartile_toxconc_Hisp_full_set_bootcl.dta saved

. restore

. 
. *end
. 
end of do-file
